//package com.example.uchain.task;
//
//import com.example.uchain.demo.Notify;
//import com.example.uchain.service.INotifyService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import java.time.LocalDateTime;
//import java.util.Random;
//
//
///**
// * 定时任务
// */
//@Component
//@Slf4j
//public class task {
//
//    @Autowired
//    private INotifyService notifyService;;
//
////    @Scheduled(cron = "0 0/1 * * * ?")//每分钟执行一次
//    @Scheduled(cron = "0/2 * * * * ?")//每5秒执行一次
//    public void processTimeoutOrder() {
//        log.info("定时心率数据");
//        Notify notify = new Notify();
//        Random Random = new Random();
//        int heartRate = Random.nextInt(41) + 80; // 生成80到120之间的随机数
//        notify.setHeartRate(String.valueOf(heartRate));
//        notify.setTimeTe(LocalDateTime.now());
//        notifyService.save(notify);
//        }
//    }
